package tarantula.experiment.jdkutils;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestResult;
import junit.framework.TestSuite;
import junit.textui.TestRunner;

public class RunPassingTestsWithSimpleTest extends TestCase {
	public static void main(String[] args) {
		TestRunner runner = new TestRunner();
	    Test t = suite();
	    int num = -1;
	    if(args.length > 0) {
	    	num = Integer.parseInt(args[0]);
	    }
	    if(num == 1) {
	    	t = suiteBug1();
	    } else if (num == 2) {
	    	t = suiteBug2();
	    }
	    TestResult result = runner.doRun(t, false);
	    if (! result.wasSuccessful()) {
	      System.exit(1);
	    }
	  }

	  public RunPassingTestsWithSimpleTest(String name) {
	    super(name);
	  }

	  public static Test suite() {
	    TestSuite result = new TestSuite();
	    result.addTest(new TestSuite(JDKTestsForTarantula0.class));
	    
	    result.addTest(new TestSuite(JDKFailedTestsSimpleTest.class));
	    
	    return result;
	  }
	  
	  public static Test suiteBug1() {
		    TestSuite result = new TestSuite();
		    result.addTest(new TestSuite(JDKTestsForTarantula0.class));
		    
		    result.addTest(new TestSuite(JDKFailedTestsSimpleTestBug1.class));
		    
		    return result;
		  }
	  
	  public static Test suiteBug2() {
		    TestSuite result = new TestSuite();
		    result.addTest(new TestSuite(JDKTestsForTarantula0.class));
		    
		    result.addTest(new TestSuite(JDKFailedTestsSimpleTestBug2.class));
		    
		    return result;
		  }
}
